
/*
 * 	REQUEST MESSAGE
 *	from the user client to the server node, asking for data
 *
 */

{
	action: "request",
	v: 1.0,
	for: "myfacespace.com",
	who: "ian@peerweave.com",
	when: 1308123421,
	expiry: 1308283200,
	token: "596ef987496dd91d0df28dc86c7257ae5f4363bfc52d2a9c4e365770fb755d9ef93c2d48191b6dae55a5226cc69b493ee05a814782fa8a1bff41e0c2064adc0b",
	
	get: [
	    
	    { 
	    	type: 	"user", //specify multiple users requested
            fields: ["uid", "name_first", "name_last", "birthday", "email"],
            uids: 	["nate34", "tommy1996", "privacyman76"]
	    },
	    
	    /*	returns individual images
	     *	the title "image" is arbitrary. You can give any title and the server node will accept it if it recognizes it
	     *	the uid of any entity (such as images, videos, polls, files, collections) must be unique amongst all entities on the node.
	     *	this is because all entities can be "liked" or be commented on.
	     */
	    {
	    	type: 	"image",
            fields: ["uid", "url_medium", "name", "description", "comment_count", "rating"],
            uids: 	["3ee05a814", "ae5f4363", "3c52d2a65", "57ae5f436", "ff41e0c2"]
	    },
	    
	    //returns a list of collections for the following users
	    {
        	type: 	"images[]", 					//the [] signifies that this is a collection and not the individual images
            fields: ["uid", "owner", "posted_on"],	//what fields are to be returned
            limit: 	4,
            offset: 0,
            order: 	"date"
            sort: 	"asc",
            uids: 	["nate34", "tommy1996"]			//result s returned can match EITHER uid (simple queries only)
        },
        
        {
        	type: 	"videos[]",
            fields: ["uid", "owner", "posted_on"],
            limit: 	1,
            offset: 10,
            order:	"date"
            sort: 	"asc",
            uids: 	["nate34", "tommy1996"]
        }
	],
	
	set: {  
		//these items will be processed on the server node in the order presented.
		//they do not have to be provided grouped together by type.
		//The only required field in each element is the `type` field.
        {
        	//new message
            type: "message",
            uids: ["nate34", "jobe4"],
            body: "Hey guys, what's going on?"
		},
		
        //replying to an existing message chain
    	{
            type: 	"message",
            parent:	927,
            body: 	"yeah right, you're the jerk, not me!"
        },
        
        //relationships
    	{ type: "relationship", uid: "jeremy", action: "add" },
    	{ type: "relationship", uid: "robert", action: "add" },
    	{ type: "relationship", uid: "richard", action: "remove" },
    	{ type: "relationship", uid: "steve", action: "remove" },
		{ type: "relationship", uid: "nate", action: "deny" },
		{ type: "relationship", uid: "tomasz", action: "approve" },
        
       	//event
       	{ type: "rsvp", uid: "49ff2a9c", status: "attending" },
       	{ type: "rsvp", uid: "44fdc99c", status: "maybe attending" },
       	{ type: "rsvp", uid: "923ee26f", status: "remove" },
       	
       	//group
       	{ type: "group", uid: "efa458ac", action: "join" },
   		{ type: "group", uid: "ac21d8dd", action: "leave" }
	}
}

